/* eslint-disable indent */
'use strict';
/**
 * schema
 * @description user 数据格式校验
 */

// 配置规则
module.exports = {
    type: 'object',
    properties: {
        userName: {
            type: 'string',
            minLength: 1,
            maxLength: 20,
            pattern: '^[a-zA-Z0-9][a-zA-Z0-9_/.]+$',
        },
        password: {
            type: 'string',
            minLength: 1,
            maxLength: 20,
            pattern: '^[a-zA-Z0-9][a-zA-Z0-9_/.]+$',
        },
        gender: {
            type: 'number',
            minimum: 1,
            maximum: 3,
        },
        nickName: {
            type: 'string',
            minLength: 1,
            maxLength: 20,
        },
        avatar: {
            type: 'string',
            maxLength: 255,
        },
        city: {
            type: 'string',
            minLength: 2,
            maxLength: 25,
        },
    },
    $async: true, // 异步
};